<h3 class="header smaller lighter blue mg-bottom20 mg-top12" xmlns="">产品图片添加</h3>
<form class="form-horizontal" action="/manage/pigFileUpload/1" method="post" enctype="multipart/form-data" id="ad">
    {!! csrf_field() !!}
    <input type="hidden" name="product_id" value="{{$id}}">
    <div class="widget-body">
        <div class="">
            <div class="g-backrealdetails clearfix bor-border">
                @foreach($files as $k => $v)
                    <div class="form-group interface-bottom col-xs-12">
                        {{--<label class="col-sm-1 control-label no-padding-right" for="form-field-1">图片{{$k}}</label>--}}
                        <div class="col-sm-4">
                            <div class="memberdiv pull-left">
                                <div class="position-relative">

                                    <div id="imgdiv2">
                                        @if(isset($v['file_path']))
                                            <img id="imgShow2" width="120" height="120" src="{{url($v['file_path'])}}" />
                                        @else
                                            <img id="imgShow2" width="120" height="120"  />
                                        @endif
                                    </div>

                                    <a  imgid="{{$v['id']}}" class="del_img filea btn btn-sm btn-primary btn-block " href="javascript:void(0);">
                                        删除此图片
                                        <input class="btn-file"   name="web_logo_2" />
                                    </a>
                                </div></div>
                        </div>
                    </div>
                @endforeach
                <table class="table table-hover">
                    <tbody>
                    <tr>
                        <td></td>
                        <td>
                            <div class="memberdiv pull-left">
                                <div class="position-relative">
                                    <input multiple="" type="file" name="file" id="id-input-file-3" />
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td class="text-right"></td>
                        <td class="text-left">
                            <button type="submit" class="btn btn-primary btn-sm">提交</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</form>
</div>
</div>
</div>

{!! Theme::asset()->container('custom-css')->usePath()->add('backstage', 'css/backstage/backstage.css') !!}
{!! Theme::asset()->container('custom-js')->usePath()->add('js0', 'js/jquery.min.js') !!}
<script>
    $('.del_img').click(function(){
        var id = $(this).attr('imgid');
        var url = "{{url('manage/pigFileDel')}}";
        var _token = "{{csrf_token()}}";
        $.post(
            url,
            {
                id:id,
                _token:_token
            },
            function(e){
                alert(e);
            }
        )
    })
</script>